package com.neuedu.codeg;

import com.neuedu.yyzx.entity.User;
import org.junit.jupiter.api.Test;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class BCrypt {


    @Test
    public void testEncity(){
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();

        String dbPassword = "$2a$10$0nYMHpHlofHtVCmZcWhPGuX5aRTg8XJnht1VT/iHOdRuOQZMqcMoC";
//        User user= new User();
//        String enPassword = bCryptPasswordEncoder.encode(user.getPassword()); //加密之后的密码
//        user.setPassword( enPassword);


        System.out.println(bCryptPasswordEncoder.matches("123456",dbPassword));

    }
}
